package com.zjxf.config.web;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * created with IntelliJ IDEA
 *
 * @author: create by limu
 * Date: 2019/11/12
 * Time：10:24
 */
//@Profile({"database-dev"})
//@EnableSwagger2
@Configuration
public class SwaggerConfig {
    /**
     * app端接口配置
     *
     * @return Docket
     */
    @Bean
    public Docket createWeChatApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .groupName("app_interface")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.zjxf.controller"))
                .paths(PathSelectors.any())
                .build();//创建文档
    }
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("接口文档")
                .description("未检小程序")
                .version("1.0")
                .build();
    }

}
